/*
 * MapPoint.cpp
 *
 *  Created on: Nov 21, 2009
 *      Author: jbarreneche
 */

#include "MapPoint.h"
#include "util/MathUtils.h"
#include <string>

using namespace std;

bool MapPoint::between(MapPoint A, MapPoint B){
	double minX = min(A.getX(), B.getX());
	double maxX = max(A.getX(), B.getX());
	if (util::doubleIsBetween(this->getX(), minX, maxX, true)){
		double minY = std::min(A.getY(), B.getY());
		double maxY = std::max(A.getY(), B.getY());
		if (util::doubleIsBetween(this->getY(), minY, maxY, true)){
			return true;
		}
	}
	return false;
}

bool MapPoint::operator!=(const MapPoint &anOther) {
	return !((*this) == anOther);
}
